<HTML><HEAD><TITLE>[+File_1, ...., +File_N]</TITLE>
</HEAD><BODY>[ <A HREF="index.html">Predicate Database and Compiler</A> | <A HREF="../../index.html">Reference Manual</A> | <A HREF="../../fullindex.html">Alphabetic Index</A> ]
<H1>[+File_1, ...., +File_N]</H1>
Compile source file or load precompiled file, or list of files
<DL>
<DT><EM>File_i</EM></DT>
<DD>Atom or string.
</DD>
</DL>
<H2>Description</H2>

   The behaviour of this construct is different according to where it is used:
   As a directive in a source file, e.g.
<PRE>
	:- [auxiliaries,tools].
</PRE>
   it behaves like an include/1 directive, i.e. it instructs the compiler (or
   any other source-processing tool) to process the given files as if they were
   part of the file containing the directive.
<P>
   When called as a query (e.g. at the interactive toplevel) or goal, it will
   compile source files or load precompiled files.  If a precompiled file
   exists (usually characterized by a .eco file suffix), then this file is
   loaded, otherwise a source file is expected and compiled using compile/1.
   See the specification of compile/1 for details.
<P>
   A particular common use at the toplevel is the special form:
<PRE>
	?- [user].
</PRE>
   which is used for interactively compiling code from the standard input.

<H3>Modes and Determinism</H3><UL>
<LI>[+] is det
</UL>
<H3>Modules</H3>
This predicate is sensitive to its module context (tool predicate, see @/2).
<H3>Exceptions</H3>
<DL>
<DT><EM>(4) instantiation fault </EM>
<DD>File_n is not instantiated.
<DT><EM>(5) type error </EM>
<DD>File_n is instantiated, but not to an atom or string.
<DT><EM>(171) File does not exist :  </EM>
<DD>File_n does not exist.
</DL>
<H2>Examples</H2>
<PRE>
Success:
     [hanoi].         % compiles the file hanoi.pl

     [eclipse]: sh('cat file1').
     p:-writeln(hello).
     yes.
     [eclipse]: sh('cat file2').
     q(X) :- write(X).
     yes.
     [eclipse]: [user], p.
      p :- writeln(hi).
      user compiled 92 bytes in 0.00 seconds
     hi
     yes.
     [eclipse]: [file1, file2], p.
     /home/lp/user/file1 compiled 32 bytes in 0.02 seconds
     /home/lp/user/file2 compiled 92 bytes in 0.00 seconds
     hello
     yes.
Error:
     [F].            (Error 4).
     [file1/1].      (Error 5).
     [noexist].      (Error 171).



</PRE>
<H2>See Also</H2>
<A HREF="../../kernel/compiler/compile-1.html">compile / 1</A>, <A HREF="../../kernel/compiler/compile-2.html">compile / 2</A>, <A HREF="../../lib/fcompile/fcompile-1.html">fcompile : fcompile / 1</A>
</BODY></HTML>
